Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: account mapping file for consolidated CT #252

Merged
merged 1 commit into from
Dec 2, 2020

Conversation

afiune
Copy link
Contributor

@afiune afiune commented Nov 24, 2020

This refactor is modifying the behavior of the Encode and Decode
functions to use []byte instead of string, this way we won't be
casting its content back and forth like this example:

lacework/terraform-provider-lacework#43

Additionally, I have made the lacework integration show command to
display the account mapping content.

$ lacework int show TECHALLY_53DFFB3E788A30BD84AD1822B06473018B2B4CBA0C1AD4C
                      INTEGRATION GUID                     |              NAME              |    TYPE    | STATUS  | STATE
-----------------------------------------------------------+--------------------------------+------------+---------+--------
  TECHALLY_53DFFB3E788A30BD84AD1822B06473018B2B4CBA0C1AD4C | A consolidated CloudTrail      | AWS_CT_SQS | Enabled | Ok

                                           INTEGRATION DETAILS
----------------------------------------------------------------------------------------------------------
    ROLE ARN              | arn:aws:iam::123483698038:role/lacework_iam_role
    EXTERNAL ID           | bubulubu
    QUEUE URL             | https://sqs.us-west-2.amazonaws.com/123483698038/lacework-ct-sqs-tech-ally
    ACCOUNT MAPPING FILE  | {
                          |   "defaultLaceworkAccountAws": "mini-ally",
                          |   "integration_mappings": {
                          |     "customerdemo": {
                          |       "aws_accounts": [
                          |         "934534535",
                          |         "553453453"
                          |       ]
                          |     },
                          |     "tech-ally": {
                          |       "aws_accounts": [
                          |         "774564564",
                          |         "234556677"
                          |       ]
                          |     }
                          |   }
                          | }
    UPDATED AT            | 2020-Nov-24 14:05:58 UTC
    UPDATED BY            | [email protected]
    STATE UPDATED AT      | 2020-Nov-24 14:06:02 UTC
    LAST SUCCESSFUL STATE | 2020-Nov-24 14:06:02 UTC

Signed-off-by: Salim Afiune Maya [email protected]

This refactor is modifying the behavior of the Encode and Decode
functions to use `[]byte` instead of `string`, this way we won't be
casting its content back and forth like this example:

lacework/terraform-provider-lacework#43

Additionally, I have made the `lacework integration show` command to
display the account mapping content.

```
$ lacework int show TECHALLY_53DFFB3E788A30BD84AD1822B06473018B2B4CBA0C1AD4C
                      INTEGRATION GUID                     |              NAME              |    TYPE    | STATUS  | STATE
-----------------------------------------------------------+--------------------------------+------------+---------+--------
  TECHALLY_53DFFB3E788A30BD84AD1822B06473018B2B4CBA0C1AD4C | A consolidated CloudTrail      | AWS_CT_SQS | Enabled | Ok

                                           INTEGRATION DETAILS
----------------------------------------------------------------------------------------------------------
    ROLE ARN              | arn:aws:iam::123483698038:role/lacework_iam_role
    EXTERNAL ID           | bubulubu
    QUEUE URL             | https://sqs.us-west-2.amazonaws.com/123483698038/lacework-ct-sqs-tech-ally
    ACCOUNT MAPPING FILE  | {
                          |   "defaultLaceworkAccountAws": "mini-ally",
                          |   "integration_mappings": {
                          |     "customerdemo": {
                          |       "aws_accounts": [
                          |         "934534535",
                          |         "553453453"
                          |       ]
                          |     },
                          |     "tech-ally": {
                          |       "aws_accounts": [
                          |         "774564564",
                          |         "234556677"
                          |       ]
                          |     }
                          |   }
                          | }
    UPDATED AT            | 2020-Nov-24 14:05:58 UTC
    UPDATED BY            | [email protected]
    STATE UPDATED AT      | 2020-Nov-24 14:06:02 UTC
    LAST SUCCESSFUL STATE | 2020-Nov-24 14:06:02 UTC

```

Signed-off-by: Salim Afiune Maya <[email protected]>
@afiune afiune added cli Something related to the Lacework CLI api Something related to the Go API client labels Nov 24, 2020
@afiune afiune self-assigned this Nov 24, 2020
Copy link
Contributor

@scottford-lw scottford-lw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@afiune afiune merged commit 402a363 into master Dec 2, 2020
@afiune afiune deleted the afiune/account-mapping-file branch December 2, 2020 21:00
@afiune afiune mentioned this pull request Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Something related to the Go API client cli Something related to the Lacework CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants